const path = require("path")
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');

const base = {
  mode: 'production',
  entry: ["./src/main.js"],
  output: {
    path: path.resolve(__dirname, "dist"),
    // filename: 'static/js/[name].js',
    // publicPath: './',
    filename: 'main.js',
    library: 'MoreSheetExcel',
    globalObject: 'this',
    libraryExport: 'default',
    libraryTarget: 'umd'
  },
  module: {
    rules: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: 'babel-loader'
    }]
  },
  optimization: {
    minimize: true,
    minimizer: [
      new UglifyJSPlugin()
    ]
  },
  // plugins: [new webpack.BannerPlugin({
  //   banner
  // })]
}

const devBase = {
  ...base,
}
const proBase = {
  ...base,

}


module.exports = proBase